bts = gdb.execute("bt", to_string=True)
dep = len(bts.split('\n')) - 1
for i in range(dep):
    print("===== frame: %d =====" % i)
    gdb.execute("f %d" % i)
    gdb.execute("i sym $pc")
gdb.execute("f 0")
